syms sigma x y mu

q=exp(-(log(y/x)-mu)^2/2/sigma^2);

diff(q,x,2)

diff(q,x,3)


(mu^2 + mu*sigma^2 - 2*mu*log(y/x) - sigma^2*log(y/x) - sigma^2 + log(y/x)^2) / ( sigma^4*x^2*exp((mu - log(y/x))^2 / (2*sigma^2) ) )
 
(mu^2 + mu*sigma^2 - 2*mu*log(y/x) - sigma^2*log(y/x) - sigma^2 + log(y/x)^2) / ( sigma^4*x^2*exp((mu - log(y/x))^2 / (2*sigma^2) ) )
 

-((sigma^2 + mu - log(y/x))*(mu^2 + 2*mu*sigma^2 - 2*mu*log(y/x) - 2*sigma^2*log(y/x) - 3*sigma^2 + log(y/x)^2))/(sigma^6*x^3*exp((mu - log(y/x))^2/(2*sigma^2)))
 

 ((sigma^2 + mu - log(y/x))*(- mu^2 - 2*mu*sigma^2 + 2*mu*log(y/x) + 2*sigma^2*log(y/x) + 3*sigma^2 - log(1/x*y)^2))/(sigma^6*x^3*exp((mu^2 - 2*mu*log(y/x) + log(y/x)^2)/(2*sigma^2)))
 
 
 (mu^2 + mu*sigma^2 - 2*mu*log(y/x) - sigma^2*log(y/x) - sigma^2 + log(y/x)^2)/(sigma^4*x^2*q)
 =((mu-log(y/x)^2)+sigma^2(mu-log(y/x))-sigma^2)/sigma^4/x^2/q
 
 
 - ((sigma^2 + mu - log(y/x))*(mu^2 + 2*mu*sigma^2 - 2*mu*log(y/x) - 2*sigma^2*log(y/x) - 3*sigma^2 + log(y/x)^2))/(sigma^6*x^3*q)
 